package com.gxy.learn.design.model.behaviour.command;

/**
 * @description: 命令模式测试
 * @author: gaoxueyong
 * @Date: 2022/11/8 14:51
 */
public class Client {
    public static void main(String[] args) {
        Order order = new Order();
        order.setDiningTable(1);
        order.setFood("西红柿鸡蛋面",1);
        order.setFood("小杯可乐",2);
//        创建订单对象
        Order order2 = new Order();
        order2.setDiningTable(2);
        order2.setFood("大盘鸡",1);
        order2.setFood("大杯可乐",2);
//        创建厨师对象
        SeniorChef seniorChef = new SeniorChef();
//        创建命令对象
        OrderCommand cmd = new OrderCommand(seniorChef,order);
        OrderCommand cmd2 = new OrderCommand(seniorChef,order2);
//        创建者调用
        Waitor invoke = new Waitor();
        invoke.setCommand(cmd);
        invoke.setCommand(cmd2);
        invoke.orderUp();
    }
}
